package test;


import org.apache.http.Header;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicHeader;

import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.*;

/**
 * Created by kevin on 2020/2/9.
 */
public class test2 {
    public static void main(String[] args) {
//        String client_id = "20200208153133564458963";
//        String client_secret = "d7c0107a-2c32-4e1e-add1-178e42f80068";
//
//        Header[] headers = {new BasicHeader("Content-Type","application/json")};
//        Map<String, Object> paramMaps = new HashMap<>();
//        paramMaps.put("client_id", client_id);
//        paramMaps.put("client_secret", client_secret);
//        String resutlMsg = HttpUtil.doPost("https://open.welink.huaweicloud.com/api/auth/v2/tickets", headers, paramMaps);
//        System.out.println("return info is : " + resutlMsg);

//        JSONObject jsonObject = new JSONObject();
//        jsonObject.put("client_id",client_id);
//        jsonObject.put("client_secret",client_secret);
//        String resutlMsg2 = HttpRequestUtils.doPost("https://open.welink.huaweicloud.com/api/auth/v2/tickets", jsonObject);
//        System.out.println("return info is : " + resutlMsg2);

//        String resutlMsg2 = HttpRequestUtils.doGet("https://open.welink.huaweicloud.com/api/auth/v2/userid?code=01AC5DA1F2DB02C518303E554308E50F1433FC843A7D17504BB24126A20B0EED","7e1d0d55-524f-4df9-a6f7-bafedda3a00a");
//        System.out.println(resutlMsg2);

//        JSONObject paramMaps = new JSONObject();
//        paramMaps.put("grant_type","password");
//        paramMaps.put("client_secret","wyuVEH7jDTE0gXNJGctT40aOk9XiNwR2R39lxXtyX7GM7JIGJ6j5dxxE");
//        paramMaps.put("client_id","m6S4XErzM5ZE0W6rf8BfyECTwmWWihQ0vHegzGYhxyI2TvZb8d06JZda");
//        paramMaps.put("flag","3");
//        paramMaps.put("username","18322912059");
//        paramMaps.put("password","oRnEl1EtV6V-yog0_iGjl7aFQ744");
//        String resutlMsg2 =   HttpRequestUtils.doPost("http://api.butterflytang.com/oauth2/token",paramMaps);
//        System.out.println("return info is : " + resutlMsg2);//

//        String resutlMsg2 =   HttpRequestUtils.sendPost("http://api.butterflytang.com/oauth2/token","grant_type=password&client_secret=wyuVEH7jDTE0gXNJGctT40aOk9XiNwR2R39lxXtyX7GM7JIGJ6j5dxxE&client_id=m6S4XErzM5ZE0W6rf8BfyECTwmWWihQ0vHegzGYhxyI2TvZb8d06JZda&flag=3&username=18322912059&password=oRnEl1EtV6V-yog0_iGjl7aFQ744");
//        System.out.println("return info is : " + resutlMsg2);

        String resutlMsg3 =   HttpRequestUtils.sendPost("https://nbd-api.2025123.net/oauth2/token","grant_type=password&client_secret=Y6Va4WPoJU52FQ4IRxgnVzJZzedjn4AjwVhG5gCF5kRxofjMHscoOuNt&client_id=572j44OlQrsLPSqFVtKf6nolAEXiboPm0e5MibwRdKwmDSKoimBsBZLl&flag=3&username=18322912059&password=oN8ECwKztFLlW0VFOpaC81DuFn3E");
        System.out.println("return info is : " + resutlMsg3);
    }

}
